package com.woniuxy.action;


import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

import com.opensymphony.xwork2.ActionSupport;

public class FileDownloadAction extends ActionSupport{
	
	private String filePath;
	
	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}
	
	public InputStream getInputStream(){
		System.out.println(filePath);
		InputStream input = null;
		try {
			input = new FileInputStream(new File("D:\\te\\Maven_Test\\Maven_Struts\\src\\main\\webapp\\img\\"+filePath));
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		}
		return input;
	}
	
	@Override
	public String execute() throws Exception {
		
		return SUCCESS;
	}
}
